package com.tbit.main.controller;

import com.tbit.main.common.JsonResult;
import com.tbit.main.pojo.BrandConfig;
import com.tbit.main.service.BrandConfigService;
import com.tbit.main.util.Assert;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author <a href="mailto:li.yao@tbit.com.cn">yao</a>
 * @version 4.3.0
 * @since 2024/12/26 9:58
 */
@RequestMapping("/brandConfig")
@RestController
public class BrandConfigController {

    @Resource
    private BrandConfigService brandConfigService;

    /**
     * 根据品牌名称获取品牌配置信息
     */
    @RequestMapping(value = "/getByName")
    public JsonResult<BrandConfig> getByName(String name) {
        Assert.hasLength(name, "ver.brandName.notNull");
        BrandConfig brandConfig = brandConfigService.getByName(name);
        return JsonResult.succ(brandConfig);
    }

}
